home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / Host Automation Folder / SPEC Libs / OutPut.Lib < prev    next >
Encoding:
Text File  |  1998-03-19  |  3.5 KB  |  97 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        OutPut.Lib
  5. #
  6. #    Contains:    Tasks used for output
  7. #
  8. #    Written by:    KTA, KL, ML, GS et al
  9. #
  10. #    Copyright:    © 1993-1995 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #    <1.0.14>      5/8/95    ML        define global gLogStrCount if undefined
  19. #    <1.0.13>     4/14/95    KTA        LogStr() - Added support for AIQ reporting.
  20. #    <1.0.12>      4/5/95    ML        Removed LogPriority parameter
  21. #    <1.0.11>      4/5/95    ML        Remove libraries declaration
  22. #    <1.0.10>     2/28/95    ML        marked
  23. #     <1.0.9>    12/13/94    KTA        Removed TargetCheck()
  24. #     <1.0.8>    12/13/94    ML        Removed gloglevel
  25. #     <1.0.7>    11/29/94    ML        Added exception handling support
  26. #     <1.0.6>     4/20/94    ML        Marked.
  27. #     <1.0.5>     12/2/93    KTA        LogStr()- added gLogStrHook to do anything custom after logging.
  28. #     <1.0.3>      6/8/93    NAGA        unmark tasks that are not published
  29. #     <1.0.2>     5/21/93    NAGA        Adding header and porting old files to follow new standards
  30. #
  31. # ****************************************************************************
  32.  
  33. ########################################################################
  34. #                            External libraries 
  35. #=======================================================================
  36. #########################################################################
  37. #                    LogStr(pTheString, pLogPriority,pReportLibTask)
  38. #========================================================================
  39. # Author:        KTA
  40. # Description:    Match the target and print it with whatever is passed
  41. #                to it in the 'str' parameter.  Set the appropriate 
  42. #                LogPriority based on the context of the string.
  43. # Parameters:    pTheString - string to be printed
  44. #                LogPriority -    The priority of the string to be printed
  45. #                0 - No logging
  46. #                1 - Errors
  47. #                2 - Comments and Notes
  48. #                3 - Summary information
  49. #                4 - More detailed
  50. #                5 - Detailed description
  51. # Returns:        Nothing
  52. # Examples:        LogStr("It worked");
  53. #                LogStr("It worked",3);
  54. # Assumptions:        None 
  55. #========================================================================
  56. # History:
  57. # KTA    12/01/93     Added gLogStrHook
  58. #    ML    12/12/94    Removed gloglevel, don't use LogPriority
  59. #                    removed gTargetCheck, just output gApptitle if defined
  60. #                    Added another hook for app verification
  61. #    ML    4/5/95        Removed LogPriority parameter
  62. #    KTA    4/11/95        Added support for AIQ reporting.
  63. #    ML    5/8/95        define global gLogStrCount if undefined
  64. #########################################################################
  65. TASK LogStr(pTheString, pLogPriority := 5,pReportLibTask := 'RStatus') 
  66. begin
  67.     if(global gUseReportLibHooks) AND not(isUndefined(global gReportLibHooks))
  68.     begin
  69.         returnVal := call(assoc(pReportLibTask, gReportLibHooks),pTheString,pLogPriority);
  70.         
  71.         if(global gLogStrHook2)
  72.             Call(gLogStrHook2);
  73.         
  74.         return returnVal;
  75.     end;
  76.     else
  77.     begin
  78.         theStr := '';
  79.         
  80.         if(global gLogStrHook1)
  81.             Call(gLogStrHook1);
  82.             
  83.         if (global gAppVerify) and (global gAppTitle)
  84.             theStr := "(Target - Application:∂'{global gAppTitle}∂')";
  85.     
  86.         if not (global gDisableAllLogging)
  87.         begin
  88.             if isundefined(global gLogStrCount)
  89.                 gLogStrCount := 0;
  90.             global gLogStrCount := gLogStrCount + 1;
  91.             println gLogStrCount," - ",pTheString," {theStr} ";
  92.         end;
  93.         
  94.         if(global gLogStrHook2)
  95.             Call(gLogStrHook2);
  96.     end;    
  97. end; # LogStr()